// 完全背包模板问题
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N = 3010;
LL f[N];
int n, m;

int main()
{
    cin >> n >> m;
    f[0] = 1;
    while (n--)
    {
        int a;
        cin >> a;
        for (int i = a; i <= m; ++i)
            f[i] += f[i - a];
    }
    cout << f[m] << endl;
    return 0;
}